package com.xjc.business.service;

import com.xjc.business.entity.domain.AllStudentStayRelations;
import com.xjc.business.entity.domain.Buildings;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xjc.business.entity.po.schadmin.AllocaDormitoryPo;
import com.xjc.business.entity.po.schadmin.BuildingPo;
import com.xjc.business.entity.vo.buildadmin.BuildDetailsVo;
import com.xjc.business.entity.vo.buildadmin.CheckBedNotAddRoomVo;
import com.xjc.business.entity.vo.schadmin.BuildingDetailsVo;
import com.xjc.business.entity.vo.schadmin.BuildingVo;
import com.xjc.business.entity.vo.schadmin.RestBedDetails;
import com.xjc.business.entity.vo.stu.CurrentSureDormitoryVo;
import com.xjc.business.entity.vo.stu.DormitoryVo;
import com.xjc.system.result.Result;

import java.util.List;

/**
* @author root
* @description 针对表【buildings(楼宇表)】的数据库操作Service
* @createDate 2025-01-25 10:24:31
*/
public interface BuildingsService extends IService<Buildings> {

    /**
     * 获取楼宇列表
     * @param schoolId 学校id
     * @return 楼宇列表数据
     */
    Result<List<BuildingVo>> getBuildingList(Integer schoolId);

    /**
     * 新增楼宇
     * @param buildingPo 楼宇信息
     * @return 反馈
     */
    Result<String> addBuilding(BuildingPo buildingPo);

    /**
     * 分配管理员
     * @param adminId 管理员id
     * @param buildingId 楼宇id
     * @return 反馈
     */
    Result<String> associateAdmin(Integer adminId, Integer buildingId);

    /**
     * 获取楼宇详情
     * @param buildingId 楼宇id
     * @return 详情
     */
    Result<List<BuildingDetailsVo>> getBuildingDetails(Integer buildingId);

    /**
     * 获取宿舍列表
     * @param id 学生微信id
     * @return 列表数据
     */
    Result<List<com.xjc.business.entity.vo.stu.BuildingVo>> getBuildingListWithStuId(Integer id);

    /**
     * 确认选宿
     * @param bedId 床位id
     * @param id 学生微信id
     * @return 反馈
     */
    Result<String> sureSelectDormitory(Integer id, Integer bedId);

    /**
     * 获取宿舍信息
     * @param id 学生微信id
     * @return 宿舍信息
     */
    Result<DormitoryVo> getDormitoryInfo(Integer id);

    /**
     * 获取空余床位详情
     * @param schoolId 学校id
     * @return 详情
     */
    Result<RestBedDetails> getRestBedDetails(Integer schoolId);

    /**
     * 一键分配宿舍
     * @param allocaDormitoryPo 宿舍分配信息
     * @return 反馈
     */
    Result<String> allocationDormitoryWithOneClick(AllocaDormitoryPo allocaDormitoryPo);

    public void allocateBed(Integer schoolId, List<AllStudentStayRelations> allStudentStayRelationsList, List<Integer> sexStuIdList, Integer type);

    /**
     * 获取学校-宿舍楼名称
     * @param id 宿舍楼d
     * @return 学校-宿舍楼名称
     */
    Result<String> getBuildName(Integer id);

    /**
     * 去除“已被选宿舍床位列表”之外的宿舍列表
     * @param buildingId 楼宇id
     * @param hasAddRoomIdList 已被选宿舍床位列表
     * @return 列表数据
     */
    List<CheckBedNotAddRoomVo> getBuildDormitoryListWithCheckBed(Integer buildingId, List<Integer> hasAddRoomIdList);
}
